interface MongoError extends Error {
  code: number
  keyValue?: Record<string, any>
}

export function isMongoError(error: any): error is MongoError {
  return error instanceof Error && 'code' in error
}
